/*
 * MikoPBX - free phone system for small business
 * Copyright © 2017-2023 Alexey Portnov and Nikolay Beketov
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program.
 * If not, see <https://www.gnu.org/licenses/>.
 */

/*
* # Fomantic UI - 2.7.2
* https://github.com/fomantic/Fomantic-UI
* http://fomantic-ui.com/
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(me,e,M,x){"use strict";me.isFunction=me.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e=void 0!==e&&e.Math==Math?e:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),me.fn.calendar=function(m){var h,e=me(this),g=e.selector||"",D=(new Date).getTime(),v=[],y=m,b="string"==typeof y,C=[].slice.call(arguments,1),w={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}};return e.each(function(){var f,le,se=me.isPlainObject(m)?me.extend(!0,{},me.fn.calendar.settings,m):me.extend({},me.fn.calendar.settings),de=se.className,e=se.namespace,t=se.selector,ue=se.formatter,a=se.parser,pe=se.metadata,fe=w[se.minTimeGap],l=se.error,n="."+e,o="module-"+e,r=me(this),i=r.find(t.input),ce=r.find(t.popup),s=r.find(t.activator),d=this,u=r.data(o),c=!1,p=!1;le={initialize:function(){le.debug("Initializing calendar for",d,r),f=le.get.isTouch(),le.setup.config(),le.setup.popup(),le.setup.inline(),le.setup.input(),le.setup.date(),le.create.calendar(),le.bind.events(),le.instantiate()},instantiate:function(){le.verbose("Storing instance of calendar"),u=le,r.data(o,u)},destroy:function(){le.verbose("Destroying previous calendar for",d),r.removeData(o),le.unbind.events()},setup:{config:function(){null!==le.get.minDate()&&le.set.minDate(r.data(pe.minDate)),null!==le.get.maxDate()&&le.set.maxDate(r.data(pe.maxDate))},popup:function(){if(!se.inline&&(s.length||(s=r.children().first()).length))if(me.fn.popup!==x){ce.length||(ce=me("<div/>").addClass(de.popup).prependTo(s.parent())),ce.addClass(de.calendar);var e=se.onVisible,t=se.onHidden;i.length||(ce.attr("tabindex","0"),e=function(){return le.focus(),se.onVisible.apply(ce,arguments)},t=function(){return le.blur(),se.onHidden.apply(ce,arguments)});var a=se.on||(i.length?"focus":"click"),n=me.extend({},se.popupOptions,{popup:ce,on:a,hoverable:"hover"===a,onShow:function(){return le.set.focusDate(le.get.date()),le.set.mode(se.startMode),se.onShow.apply(ce,arguments)},onVisible:e,onHide:se.onHide,onHidden:t});le.popup(n)}else le.error(l.popup)},inline:function(){s.length&&!se.inline||(ce=me("<div/>").addClass(de.calendar).appendTo(r),i.length||ce.attr("tabindex","0"))},input:function(){se.touchReadonly&&i.length&&f&&i.prop("readonly",!0)},date:function(){if(i.length){var e=i.val(),t=a.date(e,se);le.set.date(t,se.formatInput,!1)}}},create:{calendar:function(){var e,t,a,n,o,r,i,l=le.get.mode(),s=new Date,d=le.get.date(),u=le.get.focusDate(),p=u||d||se.initialDate||s;p=le.helper.dateInRange(p),u||(u=p,le.set.focusDate(u,!1,!1));var f="year"===l,c="month"===l,m="day"===l,h="hour"===l,g="minute"===l,D="time"===se.type,v=Math.max(se.multiMonth,1),y=m?le.get.monthOffset():0,b=p.getMinutes(),C=p.getHours(),w=p.getDate(),M=p.getMonth()+y,x=p.getFullYear(),T=m?se.showWeekNumbers?8:7:h?4:fe.column,k=m||h?6:fe.row,N=m?v:1,O=ce,F=O.hasClass("left")?"right center":"left center";for(O.empty(),1<N&&(i=me("<div/>").addClass(de.grid).appendTo(O)),n=0;n<N;n++){if(1<N)O=me("<div/>").addClass(de.column).appendTo(i);var H=M+n,I=(new Date(x,H,1).getDay()-se.firstDayOfWeek%7+7)%7;if(!se.constantHeight&&m){var Y=new Date(x,H+1,0).getDate()+I;k=Math.ceil(Y/7)}var E=f?10:c?1:0,R=m?1:0,W=h||g?1:0,j=h||g?w:1,A=new Date(x-E,H-R,j-W,C),V=new Date(x+E,H+R,j+W,C),G=f?new Date(10*Math.ceil(x/10)-9,0,0):c?new Date(x,0,0):m?new Date(x,H,0):new Date(x,H,w,-1),S=f?new Date(10*Math.ceil(x/10)+1,0,1):c?new Date(x+1,0,1):m?new Date(x,H+1,1):new Date(x,H,w+1),q=l;m&&se.showWeekNumbers&&(q+=" andweek");var P=me("<table/>").addClass(de.table).addClass(q).appendTo(O),K=T;if(!D){var U=me("<thead/>").appendTo(P);o=me("<tr/>").appendTo(U),r=me("<th/>").attr("colspan",""+T).appendTo(o);var J=f||c?new Date(x,0,1):m?new Date(x,H,1):new Date(x,H,w,C,b),z=me("<span/>").addClass(de.link).appendTo(r);z.text(ue.header(J,l,se));var L=c?se.disableYear?"day":"year":m?se.disableMonth?"year":"month":"day";if(z.data(pe.mode,L),0===n){var B=me("<span/>").addClass(de.prev).appendTo(r);B.data(pe.focusDate,A),B.toggleClass(de.disabledCell,!le.helper.isDateInRange(G,l)),me("<i/>").addClass(de.prevIcon).appendTo(B)}if(n===N-1){var Q=me("<span/>").addClass(de.next).appendTo(r);Q.data(pe.focusDate,V),Q.toggleClass(de.disabledCell,!le.helper.isDateInRange(S,l)),me("<i/>").addClass(de.nextIcon).appendTo(Q)}if(m)for(o=me("<tr/>").appendTo(U),se.showWeekNumbers&&((r=me("<th/>").appendTo(o)).text(se.text.weekNo),r.addClass(de.disabledCell),K--),e=0;e<K;e++)(r=me("<th/>").appendTo(o)).text(ue.dayColumnHeader((e+se.firstDayOfWeek)%7,se))}var Z=me("<tbody/>").appendTo(P);for(e=f?10*Math.ceil(x/10)-9:m?1-I:0,t=0;t<k;t++)for(o=me("<tr/>").appendTo(Z),m&&se.showWeekNumbers&&((r=me("<th/>").appendTo(o)).text(le.get.weekOfYear(x,H,e+1-se.firstDayOfWeek)),r.addClass(de.disabledCell)),a=0;a<K;a++,e++){var X=f?new Date(e,H,1,C,b):c?new Date(x,e,1,C,b):m?new Date(x,H,e,C,b):h?new Date(x,H,w,e):new Date(x,H,w,C,e*se.minTimeGap),$=f?e:c?se.text.monthsShort[e]:m?X.getDate():ue.time(X,se,!0);(r=me("<td/>").addClass(de.cell).appendTo(o)).text($),r.data(pe.date,X);var _=m&&X.getMonth()!==(H+12)%12,ee=_||!le.helper.isDateInRange(X,l)||se.isDisabled(X,l)||le.helper.isDisabled(X,l);if(ee){var te=le.helper.disabledReason(X,l);null!==te&&(r.attr("data-tooltip",te[pe.message]),r.attr("data-position",F))}var ae=le.helper.dateEqual(X,d,l),ne=le.helper.dateEqual(X,s,l);r.toggleClass(de.adjacentCell,_),r.toggleClass(de.disabledCell,ee),r.toggleClass(de.activeCell,ae&&!_),h||g||r.toggleClass(de.todayCell,!_&&ne);var oe={mode:l,adjacent:_,disabled:ee,active:ae,today:ne};ue.cell(r,X,oe),le.helper.dateEqual(X,u,l)&&le.set.focusDate(X,!1,!1)}if(se.today){var re=me("<tr/>").appendTo(Z),ie=me("<td/>").attr("colspan",""+T).addClass(de.today).appendTo(re);ie.text(ue.today(se)),ie.data(pe.date,s)}le.update.focus(!1,P)}}},update:{focus:function(e,t){t=t||ce;var l=le.get.mode(),a=le.get.date(),s=le.get.focusDate(),d=le.get.startDate(),u=le.get.endDate(),p=(e?s:null)||a||(f?null:s);t.find("td").each(function(){var e=me(this),t=e.data(pe.date);if(t){var a=e.hasClass(de.disabledCell),n=e.hasClass(de.activeCell),o=e.hasClass(de.adjacentCell),r=le.helper.dateEqual(t,s,l),i=!!p&&(!!d&&le.helper.isDateInRange(t,l,d,p)||!!u&&le.helper.isDateInRange(t,l,p,u));e.toggleClass(de.focusCell,r&&(!f||c)&&!o&&!a),e.toggleClass(de.rangeCell,i&&!n&&!a)}})}},refresh:function(){le.create.calendar()},bind:{events:function(){le.debug("Binding events"),ce.on("mousedown"+n,le.event.mousedown),ce.on("touchstart"+n,le.event.mousedown),ce.on("mouseup"+n,le.event.mouseup),ce.on("touchend"+n,le.event.mouseup),ce.on("mouseover"+n,le.event.mouseover),i.length?(i.on("input"+n,le.event.inputChange),i.on("focus"+n,le.event.inputFocus),i.on("blur"+n,le.event.inputBlur),i.on("click"+n,le.event.inputClick),i.on("keydown"+n,le.event.keydown)):ce.on("keydown"+n,le.event.keydown)}},unbind:{events:function(){le.debug("Unbinding events"),ce.off(n),i.length&&i.off(n)}},event:{mouseover:function(e){var t=me(e.target).data(pe.date),a=1===e.buttons;t&&le.set.focusDate(t,!1,!0,a)},mousedown:function(e){i.length&&e.preventDefault(),c=0<=e.type.indexOf("touch");var t=me(e.target).data(pe.date);t&&le.set.focusDate(t,!1,!0,!0)},mouseup:function(e){le.focus(),e.preventDefault(),e.stopPropagation(),c=!1;var t=me(e.target);if(!t.hasClass("disabled")){var a=t.parent();(a.data(pe.date)||a.data(pe.focusDate)||a.data(pe.mode))&&(t=a);var n=t.data(pe.date),o=t.data(pe.focusDate),r=t.data(pe.mode);if(n){var i=t.hasClass(de.today);le.selectDate(n,i)}else o?le.set.focusDate(o):r&&le.set.mode(r)}},keydown:function(e){if(27!==e.keyCode&&9!==e.keyCode||le.popup("hide"),le.popup("is visible"))if(37===e.keyCode||38===e.keyCode||39===e.keyCode||40===e.keyCode){var t="day"===(u=le.get.mode())?7:"hour"===u?4:"minute"===u?fe.column:3,a=37===e.keyCode?-1:38===e.keyCode?-t:39==e.keyCode?1:t;a*="minute"===u?se.minTimeGap:1;var n=le.get.focusDate()||le.get.date()||new Date,o=n.getFullYear()+("year"===u?a:0),r=n.getMonth()+("month"===u?a:0),i=n.getDate()+("day"===u?a:0),l=n.getHours()+("hour"===u?a:0),s=n.getMinutes()+("minute"===u?a:0),d=new Date(o,r,i,l,s);"time"===se.type&&(d=le.helper.mergeDateTime(n,d)),le.helper.isDateInRange(d,u)&&le.set.focusDate(d)}else if(13===e.keyCode){var u=le.get.mode(),p=le.get.focusDate();!p||se.isDisabled(p,u)||le.helper.isDisabled(p,u)||le.selectDate(p),e.preventDefault(),e.stopPropagation()}38!==e.keyCode&&40!==e.keyCode||(e.preventDefault(),le.popup("show"))},inputChange:function(){var e=i.val(),t=a.date(e,se);le.set.date(t,!1)},inputFocus:function(){ce.addClass(de.active)},inputBlur:function(){if(ce.removeClass(de.active),se.formatInput){var e=le.get.date(),t=ue.datetime(e,se);i.val(t)}},inputClick:function(){le.popup("show")}},get:{weekOfYear:function(e,t,a){var n,o,r;return n=Date.UTC(e,t,a+3)/864e5,o=Math.floor(n/7),r=new Date(6048e5*o).getUTCFullYear(),o-Math.floor(Date.UTC(r,0,7)/6048e5)+1},date:function(){return r.data(pe.date)||null},focusDate:function(){return r.data(pe.focusDate)||null},startDate:function(){var e=le.get.calendarModule(se.startCalendar);return(e?e.get.date():r.data(pe.startDate))||null},endDate:function(){var e=le.get.calendarModule(se.endCalendar);return(e?e.get.date():r.data(pe.endDate))||null},minDate:function(){return r.data(pe.minDate)||null},maxDate:function(){return r.data(pe.maxDate)||null},monthOffset:function(){return r.data(pe.monthOffset)||0},mode:function(){var e=r.data(pe.mode)||se.startMode,t=le.get.validModes();return 0<=me.inArray(e,t)?e:"time"===se.type?"hour":"month"===se.type?"month":"year"===se.type?"year":"day"},validModes:function(){var e=[];return"time"!==se.type&&(se.disableYear&&"year"!==se.type||e.push("year"),(!se.disableMonth&&"year"!==se.type||"month"===se.type)&&e.push("month"),0<=se.type.indexOf("date")&&e.push("day")),0<=se.type.indexOf("time")&&(e.push("hour"),se.disableMinute||e.push("minute")),e},isTouch:function(){try{return M.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e instanceof me||(e=r.parent().children(e).first()),e.data(o)):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=le.helper.sanitiseDate(e),e=le.helper.dateInRange(e);var n=le.get.mode(),o=ue.datetime(e,se);if(a&&!1===se.onChange.call(d,e,o,n))return!1;if(le.set.focusDate(e),se.isDisabled(e,n))return!1;var r=le.get.endDate();r&&e&&r<e&&le.set.endDate(x),le.set.dataKeyValue(pe.date,e),t&&i.length&&i.val(o)},startDate:function(e,t){e=le.helper.sanitiseDate(e);var a=le.get.calendarModule(se.startCalendar);a&&a.set.date(e),le.set.dataKeyValue(pe.startDate,e,t)},endDate:function(e,t){e=le.helper.sanitiseDate(e);var a=le.get.calendarModule(se.endCalendar);a&&a.set.date(e),le.set.dataKeyValue(pe.endDate,e,t)},focusDate:function(e,t,a,n){e=le.helper.sanitiseDate(e),e=le.helper.dateInRange(e);var o="day"===le.get.mode(),r=le.get.focusDate();if(o&&e&&r){var i=12*(e.getFullYear()-r.getFullYear())+e.getMonth()-r.getMonth();if(i){var l=le.get.monthOffset()-i;le.set.monthOffset(l,!1)}}var s=le.set.dataKeyValue(pe.focusDate,e,t);a=!1!==a&&s&&!1===t||p!=n,p=n,a&&le.update.focus(n)},minDate:function(e){e=le.helper.sanitiseDate(e),null!==se.maxDate&&se.maxDate<=e?le.verbose("Unable to set minDate variable bigger that maxDate variable",e,se.maxDate):(le.setting("minDate",e),le.set.dataKeyValue(pe.minDate,e))},maxDate:function(e){e=le.helper.sanitiseDate(e),null!==se.minDate&&se.minDate>=e?le.verbose("Unable to set maxDate variable lower that minDate variable",e,se.minDate):(le.setting("maxDate",e),le.set.dataKeyValue(pe.maxDate,e))},monthOffset:function(e,t){var a=Math.max(se.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),le.set.dataKeyValue(pe.monthOffset,e,t)},mode:function(e,t){le.set.dataKeyValue(pe.mode,e,t)},dataKeyValue:function(e,t,a){var n=r.data(e),o=n===t||n<=t&&t<=n;return t?r.data(e,t):r.removeData(e),(a=!1!==a&&!o)&&le.refresh(),!o}},selectDate:function(e,t){le.verbose("New date selection",e);var a=le.get.mode();if(t||"minute"===a||se.disableMinute&&"hour"===a||"date"===se.type&&"day"===a||"month"===se.type&&"month"===a||"year"===se.type&&"year"===a){if(!(!1===le.set.date(e))&&se.closable){le.popup("hide");var n=le.get.calendarModule(se.endCalendar);n&&(n.popup("show"),n.focus())}}else{var o="year"===a?se.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute";le.set.mode(o),"hour"===a||"day"===a&&le.get.date()?le.set.date(e):le.set.focusDate(e)}},changeDate:function(e){le.set.date(e)},clear:function(){le.set.date(x)},popup:function(){return s.popup.apply(s,arguments)},focus:function(){i.length?i.focus():ce.focus()},blur:function(){i.length?i.blur():ce.blur()},helper:{isDisabled:function(t,a){return"day"===a&&(-1!==se.disabledDaysOfWeek.indexOf(t.getDay())||se.disabledDates.some(function(e){return e instanceof Date?le.helper.dateEqual(t,e,a):null!==e&&"object"==typeof e?le.helper.dateEqual(t,e[pe.date],a):void 0}))},disabledReason:function(e,t){if("day"===t)for(var a=0;a<se.disabledDates.length;a++){var n=se.disabledDates[a];if(null!==n&&"object"==typeof n&&le.helper.dateEqual(e,n[pe.date],t)){var o={};return o[pe.message]=n[pe.message],o}}return null},sanitiseDate:function(e){return e?(e instanceof Date||(e=a.date(""+e,se)),isNaN(e.getTime())?x:e):x},dateDiff:function(e,t,a){a=a||"day";var n="time"===se.type,o="year"===a,r=o||"month"===a,i="minute"===a,l=i||"hour"===a;return e=new Date(n?2e3:e.getFullYear(),n?0:o?0:e.getMonth(),n?1:r?1:e.getDate(),l?e.getHours():0,i?se.minTimeGap*Math.floor(e.getMinutes()/se.minTimeGap):0),(t=new Date(n?2e3:t.getFullYear(),n?0:o?0:t.getMonth(),n?1:r?1:t.getDate(),l?t.getHours():0,i?se.minTimeGap*Math.floor(t.getMinutes()/se.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,a){return!!e&&!!t&&0===le.helper.dateDiff(e,t,a)},isDateInRange:function(e,t,a,n){if(!a&&!n){var o=le.get.startDate();a=o&&se.minDate?new Date(Math.max(o,se.minDate)):o||se.minDate,n=se.maxDate}return a=a&&new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),se.minTimeGap*Math.ceil(a.getMinutes()/se.minTimeGap)),!(!e||a&&0<le.helper.dateDiff(e,a,t)||n&&0<le.helper.dateDiff(n,e,t))},dateInRange:function(e,t,a){if(!t&&!a){var n=le.get.startDate();t=n&&se.minDate?new Date(Math.max(n,se.minDate)):n||se.minDate,a=se.maxDate}t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),se.minTimeGap*Math.ceil(t.getMinutes()/se.minTimeGap));var o="time"===se.type;return e?t&&0<le.helper.dateDiff(e,t,"minute")?o?le.helper.mergeDateTime(e,t):t:a&&0<le.helper.dateDiff(a,e,"minute")?o?le.helper.mergeDateTime(e,a):a:e:e},mergeDateTime:function(e,t){return e&&t?new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()):t}},setting:function(e,t){if(le.debug("Changing setting",e,t),me.isPlainObject(e))me.extend(!0,se,e);else{if(t===x)return se[e];me.isPlainObject(se[e])?me.extend(!0,se[e],t):se[e]=t}},internal:function(e,t){if(me.isPlainObject(e))me.extend(!0,le,e);else{if(t===x)return le[e];le[e]=t}},debug:function(){!se.silent&&se.debug&&(se.performance?le.performance.log(arguments):(le.debug=Function.prototype.bind.call(console.info,console,se.name+":"),le.debug.apply(console,arguments)))},verbose:function(){!se.silent&&se.verbose&&se.debug&&(se.performance?le.performance.log(arguments):(le.verbose=Function.prototype.bind.call(console.info,console,se.name+":"),le.verbose.apply(console,arguments)))},error:function(){se.silent||(le.error=Function.prototype.bind.call(console.error,console,se.name+":"),le.error.apply(console,arguments))},performance:{log:function(e){var t,a;se.performance&&(a=(t=(new Date).getTime())-(D||t),D=t,v.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:d,"Execution Time":a})),clearTimeout(le.performance.timer),le.performance.timer=setTimeout(le.performance.display,500)},display:function(){var e=se.name+":",a=0;D=!1,clearTimeout(le.performance.timer),me.each(v,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",g&&(e+=" '"+g+"'"),(console.group!==x||console.table!==x)&&0<v.length&&(console.groupCollapsed(e),console.table?console.table(v):me.each(v,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),v=[]}},invoke:function(n,e,t){var o,r,a,i=u;return e=e||C,t=d||t,"string"==typeof n&&i!==x&&(n=n.split(/[\. ]/),o=n.length-1,me.each(n,function(e,t){var a=e!=o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(me.isPlainObject(i[a])&&e!=o)i=i[a];else{if(i[a]!==x)return r=i[a],!1;if(!me.isPlainObject(i[t])||e==o)return i[t]!==x?r=i[t]:le.error(l.method,n),!1;i=i[t]}})),me.isFunction(r)?a=r.apply(t,e):r!==x&&(a=r),Array.isArray(h)?h.push(a):h!==x?h=[h,a]:a!==x&&(h=a),r}},b?(u===x&&le.initialize(),le.invoke(y)):(u!==x&&u.invoke("destroy"),le.initialize())}),h!==x?h:this},me.fn.calendar.settings={name:"Calendar",namespace:"calendar",silent:!1,debug:!1,verbose:!1,performance:!1,type:"datetime",firstDayOfWeek:0,constantHeight:!0,today:!1,closable:!0,monthFirst:!0,touchReadonly:!0,inline:!1,on:null,initialDate:null,startMode:!1,minDate:null,maxDate:null,ampm:!0,disableYear:!1,disableMonth:!1,disableMinute:!1,formatInput:!0,startCalendar:null,endCalendar:null,multiMonth:1,minTimeGap:5,showWeekNumbers:null,disabledDates:[],disabledDaysOfWeek:[],popupOptions:{position:"bottom left",lastResort:"bottom left",prefer:"opposite",hideOnScroll:!1},text:{days:["S","M","T","W","T","F","S"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",now:"Now",am:"AM",pm:"PM",weekNo:"Week"},formatter:{header:function(e,t,a){return"year"===t?a.formatter.yearHeader(e,a):"month"===t?a.formatter.monthHeader(e,a):"day"===t?a.formatter.dayHeader(e,a):"hour"===t?a.formatter.hourHeader(e,a):a.formatter.minuteHeader(e,a)},yearHeader:function(e,t){var a=10*Math.ceil(e.getFullYear()/10);return a-9+" - "+(a+2)},monthHeader:function(e,t){return e.getFullYear()},dayHeader:function(e,t){return t.text.months[e.getMonth()]+" "+e.getFullYear()},hourHeader:function(e,t){return t.formatter.date(e,t)},minuteHeader:function(e,t){return t.formatter.date(e,t)},dayColumnHeader:function(e,t){return t.text.days[e]},datetime:function(e,t){if(!e)return"";var a="time"===t.type?"":t.formatter.date(e,t),n=t.type.indexOf("time")<0?"":t.formatter.time(e,t,!1);return a+("datetime"===t.type?" ":"")+n},date:function(e,t){if(!e)return"";var a=e.getDate(),n=t.text.months[e.getMonth()],o=e.getFullYear();return"year"===t.type?o:"month"===t.type?n+" "+o:(t.monthFirst?n+" "+a:a+" "+n)+", "+o},time:function(e,t,a){if(!e)return"";var n=e.getHours(),o=e.getMinutes(),r="";return t.ampm&&(r=" "+(n<12?t.text.am:t.text.pm),n=0===n?12:12<n?n-12:n),n+":"+(o<10?"0":"")+o+r},today:function(e){return"date"===e.type?e.text.today:e.text.now},cell:function(e,t,a){}},parser:{date:function(e,t){if(!e)return null;if(0===(e=(""+e).trim().toLowerCase()).length)return null;var a,n,o,r=-1,i=-1,l=-1,s=-1,d=-1,u=x,p="time"===t.type,f=t.type.indexOf("time")<0,c=e.split(t.regExp.dateWords),m=e.split(t.regExp.dateNumbers);if(!f)for(u=0<=me.inArray(t.text.am.toLowerCase(),c)||!(0<=me.inArray(t.text.pm.toLowerCase(),c))&&x,a=0;a<m.length;a++){var h=m[a];if(0<=h.indexOf(":")){if(i<0||r<0){var g=h.split(":");for(o=0;o<Math.min(2,g.length);o++)n=parseInt(g[o]),isNaN(n)&&(n=0),0===o?i=n%24:r=n%60}m.splice(a,1)}}if(!p){for(a=0;a<c.length;a++){var D=c[a];if(!(D.length<=0)){for(D=D.substring(0,Math.min(D.length,3)),n=0;n<t.text.months.length;n++){var v=t.text.months[n];if((v=v.substring(0,Math.min(D.length,Math.min(v.length,3))).toLowerCase())===D){s=n+1;break}}if(0<=s)break}}for(a=0;a<m.length;a++)if(n=parseInt(m[a]),!isNaN(n)&&59<n){d=n,m.splice(a,1);break}if(s<0)for(a=0;a<m.length;a++)if(o=1<a||t.monthFirst?a:1===a?0:1,n=parseInt(m[o]),!isNaN(n)&&1<=n&&n<=12){s=n,m.splice(o,1);break}for(a=0;a<m.length;a++)if(n=parseInt(m[a]),!isNaN(n)&&1<=n&&n<=31){l=n,m.splice(a,1);break}if(d<0)for(a=m.length-1;0<=a;a--)if(n=parseInt(m[a]),!isNaN(n)){n<99&&(n+=2e3),d=n,m.splice(a,1);break}}if(!f){if(i<0)for(a=0;a<m.length;a++)if(n=parseInt(m[a]),!isNaN(n)&&0<=n&&n<=23){i=n,m.splice(a,1);break}if(r<0)for(a=0;a<m.length;a++)if(n=parseInt(m[a]),!isNaN(n)&&0<=n&&n<=59){r=n,m.splice(a,1);break}}if(r<0&&i<0&&l<0&&s<0&&d<0)return null;r<0&&(r=0),i<0&&(i=0),l<0&&(l=1),s<0&&(s=1),d<0&&(d=(new Date).getFullYear()),u!==x&&(u?12===i&&(i=0):i<12&&(i+=12));var y=new Date(d,s-1,l,i,r);return y.getMonth()===s-1&&y.getFullYear()===d||(y=new Date(d,s,0,i,r)),isNaN(y.getTime())?null:y}},onChange:function(e,t,a){return!0},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},isDisabled:function(e,t){return!1},selector:{popup:".ui.popup",input:"input",activator:"input"},regExp:{dateWords:/[^A-Za-z\u00C0-\u024F]+/g,dateNumbers:/[^\d:]+/g},error:{popup:"UI Popup, a required component is not included in this page",method:"The method you called is not defined."},className:{calendar:"calendar",active:"active",popup:"ui popup",grid:"ui equal width grid",column:"column",table:"ui celled center aligned unstackable table",prev:"prev link",next:"next link",prevIcon:"chevron left icon",nextIcon:"chevron right icon",link:"link",cell:"link",disabledCell:"disabled",adjacentCell:"adjacent",activeCell:"active",rangeCell:"range",focusCell:"focus",todayCell:"today",today:"today link"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",monthOffset:"monthOffset",message:"message"}}}(jQuery,window,document);